import Vue from 'vue'
import App from './App.vue'
import router from './router/index.js'
// 引入全局样式表
import './assets/global.css'
// 导入字体
import './assets/fonts/iconfont.css'
// 引入elementUi
import { Button, Icon, Form, FormItem, Input, RadioButton, Message, Main, Aside, Header, Footer, Container, MessageBox, Menu, Submenu, MenuItem, Row, Col, Breadcrumb, BreadcrumbItem, Card, Table, TableColumn, Switch, Tooltip, Pagination, Dialog, Tag, Tree, Select, Option, Cascader, Alert, Tabs, TabPane, Autocomplete } from 'element-ui'
import "element-ui/lib/theme-chalk/index.css";

// 引入全局组件treeTab
import treeTable from 'vue-table-with-tree-grid'
// 注册全局组件
Vue.component("tree-table", treeTable)

Vue.use(Button)
Vue.use(Icon)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(RadioButton)
Vue.use(Main)
Vue.use(Aside)
Vue.use(Header)
Vue.use(Footer)
Vue.use(Container)
Vue.use(Menu)
Vue.use(Submenu)
Vue.use(MenuItem)
Vue.use(Row)
Vue.use(Col)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Card)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Switch)
Vue.use(Tooltip)
Vue.use(Pagination)
Vue.use(Dialog)
Vue.use(Tag)
Vue.use(Tree)
Vue.use(Select)
Vue.use(Option)
Vue.use(Cascader)
Vue.use(Alert)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Autocomplete)
Vue.prototype.$message = Message
Vue.prototype.$msgBox = MessageBox
Vue.prototype.$confirm = MessageBox.confirm

Vue.config.productionTip = false

//使用自定义命令
Vue.directive('el-focus', {
  // 当使用了这个自定义命令自动获取当前dom
  inserted(dom) {
    // 获取当前元素焦点
    dom.children[0].focus()
    console.log(dom);
  }
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
